package com.ftg.learn.util;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author kangjx
 * @createTime 2022/9/30
 */
@Data
public class BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "主键",example = "1")
    private Integer id;

    /**
     * 逻辑删除 0 存在  1已删除
     */
    @TableLogic
    @ApiModelProperty(value = "逻辑删除",example = "0")
    private Byte isDeleted;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy年MM月dd日 HH:mm:ss",timezone="Asia/Shanghai")
    @ApiModelProperty(value = "创建时间",example = "2009-09-09 09:09:09")
    private LocalDateTime gmcCreate;

    /**
     * 最后修改时间
     */
    @JsonFormat(pattern = "yyyy年MM月dd日 HH:mm:ss",timezone="Asia/Shanghai")
    @ApiModelProperty(value = "最后修改时间",example = "2009-09-09 09:09:09")
    private LocalDateTime gmcUpdate;

}
